package com.example.demo;

import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * 防控平台请求转发处理器
 * @author zhangfr
 * @date 2021/9/6
 */
@RestController
//@Validated
@RequestMapping("/v1")
public class CarFraudRiskBridleController {

    /**
     * 风险查询发送
     * @return
     */
    @PostMapping("/riskInquirySend")
    @ResponseBody
    public String riskInquirySend(@RequestBody @Valid  Participate participate, BindingResult results) {
//        logger.info("=======================风险查询发送开始=======================");
//        logger.info("风险查询发送入参:{}" + participate);
        String response = "";
        try {
            if(results.hasErrors()) {

//                response = responseMessage.getResponseErrorMsg(participate, "99999", results.getFieldError().getDefaultMessage());
            } else {
//                response = fraudRiskBridleService.riskInquirySend(participate);
//                logger.info("风险查询发送返参response:{}", response);
            }
        } catch (Exception e) {
            e.printStackTrace();
//            logger.error("系统异常！原因:{}",e.getMessage());
//            response = responseMessage.getResponseErrorMsg(participate, "99999", e.getMessage());
        }
//        logger.info("=======================风险查询发送结束=======================");
        return response;
    }

}
